import React, { FC } from 'react';
import { Link } from 'react-router-dom';
import './Nav.scss';

interface MenuItem {
    name: string;
    path: string;
}

const menus: MenuItem[] = [
    {
        name: 'welcome',
        path: '/',
    },
    {
        name: 'antdDemo',
        path: '/antdDemo',
    },
];

const Nav: FC<any> = () => {
    return (
        <nav className="main-nav">
            {menus.map(({ name, path }: MenuItem, index: number) => (
                <Link to={path} key={index}>
                    {name}
                </Link>
            ))}
        </nav>
    );
};

export default Nav;
